package com.util;

import java.util.Random;

public class Generate {

    //生成一个地址
    public static String shen() {
            Random rand = new Random();
            int a = rand.nextInt(2) * 1;
            int b = rand.nextInt(4) * 2;
            int c = rand.nextInt(8) * 3;
            IdWorker worker = new IdWorker(a, b, c);
            System.out.println( worker.nextId());
            String ma="/BhCase/" + InvitationCodeUtils.encode( worker.nextId());
            return ma;
    }

    //将这个地址转回数字
    public static  long hui(String mk){
        String s=mk.substring(mk.indexOf("/")+1);
        System.out.println(s);
        long qu = InvitationCodeUtils.decode(s);
        return qu;
    }
}
